--  --------------------------------------------------------------------------
--  @File:        formatter.adb
--
--  @Project:     Softwarequalität Blatt 3 / Aufgabe 8
--  @Version:     1.0
--  @Created:     2012-11-01
--  @Author:      Benedikt Markt, Aleksander Zotov, Marcel Kranz
--
--  @Description: Package for formatting string outputs;
--
--  @Modifications:

with Ada.Strings.Unbounded;

package Formatter is

   --  ----------------------------------------------------------------------
   --  @Type: Alignment_Type
   --  @Description:
   --    Used to store the alignment of the text.
   type Alignment_Type is (Left, Center, Right);

   --  ----------------------------------------------------------------------
   --  @Type: Values_Array_Type
   --  @Description:
   --    Used to store an array of unbounded strings which are then put in
   --    the formatted text with the Format function
   type Values_Array_Type is
     array (Natural range <>) of
     Ada.Strings.Unbounded.Unbounded_String;

   --  -----------------------------------------------------------------------
   --  @Function: Align
   --
   --  @Description:
   --    Aligns a string left centered or right in
   --    given space.
   --  @Parameter:
   --    +Text     : Text to align.
   --    +Alignment: Alignment type.
   --    +Field    : Length of the space.
   --  @Return: Aligned text;
   function Align
     (Text : String;
      Alignment : Alignment_Type;
      Field : Natural) return String;

   --  -----------------------------------------------------------------------
   --  @Function: Format
   --
   --  @Description: Formats text by replacing a specific part of the string
   --                with its value from the Values array.
   --  @Parameter:
   --    +Text     : Text to format.
   --    +Values   : Array of values.
   --  @Return: Formatted text.
   function Format
     (Text : String;
      Values : Values_Array_Type) return String;
end Formatter;
